
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>1、网络编程 - 学习卡片</title>
      <style>
        body { font-family: sans-serif; background-color: #f0f8ff; color: #333; display: flex; flex-direction: column; align-items: center; padding: 50px 20px; }
        .header h1 { font-size: 32px; }
        .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; width: 100%; max-width: 1200px; }
        .card-container { perspective: 1200px; cursor: pointer; height: 250px; }
        .card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.7s; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
        .card-container.flipped .card { transform: rotateY(180deg); }
        .card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; flex-direction: column; box-sizing: border-box; border-radius: 16px; background-color: #fff; padding: 24px; }
        .card-back { background-color: #f0fff4; transform: rotateY(180deg); justify-content: space-between; }
        .card-category { font-size: 14px; color: #0052d9; margin-bottom: 8px; font-weight: 500; }
        .card-question { font-size: 20px; font-weight: 500; flex-grow: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
        .card-answer-wrapper { flex-grow: 1; overflow-y: auto; }
        .card-answer { font-size: 15px; line-height: 1.7; }
        .card-footer { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 16px; margin-top: 16px; }
        .card-source { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 12px; margin-top: 12px; }
      </style>
    </head>
    <body>
      <div class="header">
        <h1>1、网络编程 - 学习卡片</h1>
      </div>
      <div class="grid-container">
        
    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">理论</div>
          <div class="card-question">网络编程的三要素是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">理论</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">网络编程的三要素是：协议（例如 TCP, UDP, HTTP）、IP地址和端口号。</div>
          </div>
          <div class="card-source">来源: 3.1.4 网络编程总结 【掌握】</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">协议</div>
          <div class="card-question">请对比TCP和UDP协议的主要特点。</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">协议</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">TCP（传输控制协议）是面向连接、安全可靠、效率低、基于字节流通信且数据大小无限制的协议。而UDP（数据报协议）是面向无连接、不安全、效率高、基于数据报包形式通信且数据包大小限制在约64kb的协议。</div>
          </div>
          <div class="card-source">来源: 3.4.1 通信协议概述 【掌握】</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">模型</div>
          <div class="card-question">OSI参考模型由哪七层构成？请自上而下说出它们的名称。</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">模型</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">OSI参考模型定义了网络互联的七层框架，从上到下分别是：应用层、表示层、会话层、传输层、网络层、数据链路层和物理层。</div>
          </div>
          <div class="card-source">来源: 3.1.3.1 OSI参考模型</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">概念</div>
          <div class="card-question">什么是计算机网络？它的主要目的是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">概念</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">计算机网络是通过通信线路连接起来的若干台主机（Host），其主要目的是为了实现资源共享和信息传递。</div>
          </div>
          <div class="card-source">来源: 3.1.2 计算机网络</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">什么是回路地址（loopback address）？它对应的域名是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">回路地址是用于主机与自身进行通信的IP地址，具体的地址是 127.0.0.1，其对应的域名是 localhost。</div>
          </div>
          <div class="card-source">来源: 3.2.1 IP协议概述</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">文档中描述的DNS域名解析过程是怎样的？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">DNS域名解析器首先会查找本地的 `C:\Windows\System32\drivers\etc\hosts` 文件。如果在该文件中找不到对应的域名解析，它会再去DNS服务器中查找。</div>
          </div>
          <div class="card-source">来源: 3.2.1 IP协议概述</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">概念</div>
          <div class="card-question">端口号的作用是什么？文档中列举了哪些常见的端口号？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">概念</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">端口号是每个设备上程序的唯一数字标识。文档中列举的常见端口号有：MySQL (3306), Oracle (1521), Redis (6379), Tomcat (8080), Web服务器 (80), FTP服务器 (21)。</div>
          </div>
          <div class="card-source">来源: 3.3.1 端口号概述 【了解】</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">模型</div>
          <div class="card-question">TCP/IP模型分为哪四个层次？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">模型</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">TCP/IP参考模型将协议分为四个层次：应用层、传输层、网络层和接口层（物理层）。</div>
          </div>
          <div class="card-source">来源: 3.1.3.2 TCP/IP模型</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">在Java中进行TCP服务端编程时，`ServerSocket`类的`accept()`方法有什么特点？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">`ss.accept()`是一个阻塞式方法。这意味着程序会在此处暂停执行，直到有客户端与之建立连接后，才会继续向下执行。</div>
          </div>
          <div class="card-source">来源: 3.5.1 案例1 【掌握】</div>
        </div>
      </div>
    </div>

      </div>
    </body>
    </html>
